package com.spzx.test.t18;

import java.util.concurrent.atomic.AtomicInteger;

public class VolatileAtomicThread implements Runnable {

    // 定义一个int类型的变量
    private AtomicInteger count = new AtomicInteger(0) ;

    @Override
    public void run() {
        
        // 对该变量进行++操作，100次
        for(int x = 0 ; x < 100 ; x++) {
            System.out.println("count =========>>>> " + count.addAndGet(1));
        }
        
    }

}